home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / Q_TUT1.TXT < prev    next >
Encoding:
Text File  |  1998-03-31  |  27.2 KB  |  677 lines

  1. [ Written By THE_q/PC ]                                            [March 98]
  2.  
  3.         WinIce Cracking tutorial - Cracking Cruehead's CrackMe v2.0
  4.      └───────────────────────────────────────────────────────────────┘
  5.  
  6. Introduction:
  7. ══════════════╝
  8. When NuMega disigned Soft-Ice , they ment this debugger to help programers
  9. fixing their software , debugging it and quickly find the error , when the
  10. High-lenguage debugger didn't help . However , as it turned up , the debugger
  11. has become an importent tool for the CrAcKeR .
  12. This tutorial , mainly for new bees, will help you to work with the BEST
  13. debugger in the world - WinICE.
  14. Like the ladder for the painter , winice will help you disable,enable,study
  15. or in other words - crack ANY protection out there .
  16.  
  17. What you Need:
  18. ═══════════════╝
  19. -The program to crack : CrackME v2.0 - written by Cruehead/MiB
  20.   (it is propably attached to this text file,since it's a small windowz prog.)
  21.  
  22. -And geuss what ?   WINICE !! :)  Newest ver 3.22 .
  23.   Try http://cracking.home.ml.org  -LordCaligo cracking site .
  24.   Or search in ftp search for file : siw95-32.zip
  25.                                 and  si322p95.exe    (on NuMega ftp site)
  26.  
  27. Geting WinICE started:
  28. ═══════════════════════╝
  29. First , you need to edit winice.dat so winice will load all symbols and
  30. common win95 dlls .
  31. Open winice.dat , and go to End Of file , in the last section : Exported -
  32.  Symbols and delete all the semi-colloms .
  33.  
  34. It should look like this :
  35.  
  36. ; ***** Examples of export symbols that can be included for Windows 95 *****
  37. ;    Change the path to the appropriate drive and directory
  38. EXP=c:\windows\system\kernel32.dll
  39. EXP=c:\windows\system\user32.dll
  40. EXP=c:\windows\system\gdi32.dll
  41. EXP=c:\windows\system\comdlg32.dll
  42. EXP=c:\windows\system\shell32.dll
  43. EXP=c:\windows\system\advapi32.dll
  44. EXP=c:\windows\system\shell232.dll
  45. EXP=c:\windows\system\comctl32.dll
  46. EXP=c:\windows\system\crtdll.dll
  47. EXP=c:\windows\system\version.dll
  48. EXP=c:\windows\system\netlib32.dll
  49. EXP=c:\windows\system\msshrui.dll
  50. EXP=c:\windows\system\msnet32.dll
  51. EXP=c:\windows\system\mspwl32.dll
  52. EXP=c:\windows\system\mpr.dll
  53.  
  54. In order for us to look at the same winice screen , go to the line INIT in
  55. winice.dat (should be near the top) and change it to :
  56.  
  57. INIT="WR;WL;WD;CODE ON;X;"
  58.  
  59. Ok , Run windows with winice loaded , and press Ctrl-d to enter Winice.
  60. A typical Winice Screen :                      ~~~~~~~~
  61.  
  62. ┌───────────────────────────────────────────────────────────────────────────┐
  63. │                         -= Registers & Flags =-                           │
  64. │ EAX=00000009  EBX=0063FA46  ECX=800A0698 EDX=8009F8E8  ESI=00008A6A       │
  65. │ EDI=0063F9FC  EBP=0063F9F4  ESP=0063F9E8 EIP=004012C7  o d I S z a P c    │
  66. │ CS=0137   DS=013F   SS=013F  ES=013F   FS=2257  GS=0000                   │
  67. │───═CRACKME2!DATA+0175════════════════════════════════════════════════──── │
  68. │                           -=  Data Window  =-                             │
  69. │13F:40217E 41 42 43 44 56 31 32 33-34 00 00 00 00 00 00 00 abcDV1234.......│
  70. │13F:40217E 00 00 00 00 54 72 79 20-74 6F 20 63 72 61 63 6B ....Try to crack│
  71. ├───═══════════════════════════════════════════════════════════════════──── │
  72. │                           -=  Code Window  =-                             │
  73. │:004012BF FF7508                  push [ebp+08]                           │
  74. │:004012C2 E8D5010000              Call USER32!GetDlgItemTextA              │
  75. │:004012C7░83F801░░░░░░░░░░░░░░░░░░cmp░eax,░00000001░░░░░░░░░░░░░░░░░░░░░░░ │
  76. │:004012CA C74510EB030000          mov [ebp+10], 000003EB                   │
  77. │:004012D1 72CC                    jb 0040129F                              │
  78. │:004012D3 B801000000              mov eax, 00000001                        │
  79. │:004012D8 EB07                    jmp 004012E1                             │
  80. │:004012DA B800000000              mov eax, 00000000                        │
  81. │:004012DF EBA1                    jmp 00401282               █             │
  82. │:004012E1 50                      push eax                                 │
  83. │:004012E2 FF7508                  push [ebp+08]                            │
  84. │:004012E5 E894010000              Call 0040147E                            │
  85. │:004012EA B801000000              mov eax, 00000001                        │
  86. │:004012EF EB91                    jmp 00401282                          │
  87. │                                                                           │
  88. │───════════════════════════════CRACKME2!CODE+02C2═════════════════════──── │
  89. │                           -=  User Window  =-                             │
  90. │:? 48692020                                                               │
  91. │48692020 1214849056 "Hi  "                                                 │
  92. │:ver                                                                       │
  93. │SoftICE 3.22 (Windows 95 / Windows 98 Beta 1-2)                            │
  94. │Copyright (c) 1991-1998 NuMega Technologies ,Inc. All rights reserved.     │
  95. │:▄                                                                        │
  96. └──────────────────────────────────────────────────────────────────crackme2─┘
  97.  
  98.  
  99. Prologe
  100. ═════════╝
  101. To crack a program u must first get to the protection code , study it a bit
  102. and , well ,kill it .The Best and quickes way to locate the protection
  103. procedure is using s-ice .
  104. Sometimes u'll work throu the function that gets the Serial Entered ,
  105. Sometimes throu the beep or 'Bad_Serial' error message, sometimes throu
  106. the registery operations the program will do and sometimes using the dead
  107. listing (w32dasm) to find the address of the protection .
  108. There are many ways to locate the protection , and once located , 50% of the
  109. job is done,as for the rest s-ice will help u crack the protection in notime.
  110. One last thing , bare in mind that the coputer works in a LOgic way , so
  111. use ur Comom sense.For example,there is no point in checking the date (to see
  112. if it's expiered) if the user is already registered , so if u'll get to the
  113. date check procedure , the register/unregister check should be near it.
  114.  
  115.  
  116. Let's Rock
  117. ════════════╝
  118. Run the program , goto Help/Enter_Password and enter "abcDV1234" as password,
  119. hit the OK button , and see what happans if u enter a wrong pass.
  120. As u see there's an error message+beep to help u figure out u just entered
  121. the wrong password.We could get to the protection throu those notes the
  122. program gives out when u enter a wrong password , but I chose to get there
  123. throu the part that is responsable to get the password entered .
  124. (It's like geting off the Bus 1 stop before ur destination , instead of 1 stop
  125. after it .. Damm i wish i had a car ;)
  126.  
  127. By now u have seen me sayin' "get throu this.." 8 times ; what i meen ,and
  128. this is where s-ice enters the picture, is BREAKPOINT on the function that
  129. does the specific task of Geting the text from an edit box , or one of
  130. Puting an error message , or get the current date ..
  131. U see, the operating system and the program have a spacial relesionship,where
  132. the OS will put the text on the screen , but the program will have to call
  133. a certane function to get that text to it's own memory , where it can check
  134. if the text is correct.
  135. ok , nough said , lets crack ;)
  136.  
  137. Goto Help/Enter_Password , and enter 'abcDV1234' as password .Don't hit the
  138. OK button just yet .
  139. Enter S-ice (ctrl+D - btw, u can change it) and enter the following :
  140. ('>' is only an indicator )
  141. >Bpx GetWindowTextA     [Enter]
  142. >Bpx GetDlgItemTextA    [Enter]
  143. (BPX = BreakPoint on eXecution)
  144.               ┌────────────────────     Side Reference
  145.               │      SETTING BREAK POINTS
  146.               │     BPM, BPMB, BPMW, BPMD
  147.               │            - Breakpoint on memory access
  148.               │     BPR    - Breakpoint on memory range
  149.               │     BPIO   - Breakpoint on I/O port access
  150.               │     BPINT  - Breakpoint on interrupt
  151.               │     BPX    - Breakpoint on execution
  152.               │     BMSG   - Breakpoint on Windows message
  153.               │     BSTAT  - Breakpoint Statistics
  154.               │     CSIP   - Set CS:EIP range qualifier
  155.               │      MANIPULATING BREAK POINTS
  156.               │     BPE    - Edit breakpoint
  157.               │     BPT    - Use breakpoint as a template
  158.               │     BL     - List current breakpoints
  159.               │     BC     - Clear breakpoint
  160.               │     BD     - Disable breakpoint
  161.               │     BE     - Enable breakpoint
  162.               │     BH     - Breakpoint history
  163.               │      DISPLAY/CHANGE MEMORY
  164.               │     R      - Display/change register contents
  165.               │     U      - Un-assembles instructions
  166.               │     D, DB, DW, DD, DS, DL, DT
  167.               │            - Display memory
  168.               │     E, EB, EW, ED, ES, EL, ET
  169.               │            - Edit memory
  170.               │
  171.               └─────────────────────────────────────────────────────────
  172. What u've just did is BreakPoint on the most common functions used to get
  173. a text from an edit box . This will couse S-ice to "pop" whenever those
  174. functions are called . When poped the computer will frease (in a good way:)
  175. and u'll be able to see and change EVERYTHING . (now do u begin to see the
  176. power of s-ice ? ;)
  177.  
  178. To view all the current BreakPoint enter :
  179. >BL
  180. (BL = Breakpoint List)
  181. U should see this :
  182.  
  183. 00)   BPX USER32!GetWindowTextA
  184. 01)   BPX USER32!GetDlgItemTextA
  185.  
  186. The numbers on the left are the BreakPoint number in the list .
  187. Ok, leave s-ice and let the program continue (unawar of the danger;) . Do
  188. this by either pressing F5 , or >G  or >X   ..
  189. Ok, now press the OK button in the program ....and ... BOOm , s-ice poped !
  190.  
  191. At this point u r INSIDE the GetDlgItemTextA function .
  192. HOw do u know it's GetDlgItemTextA and not GetWindowTextA?
  193. well,s-ice says : 'Break due to BPX USER32!GetDlgItemTextA'.
  194. And how do u know u r INDISE that function ?
  195. For that look at the Line Between the Code Window , and the User Window ;It
  196. says 'USER32!,text+0654' that meens that what is currently in the code window
  197. is code from the file USER32.dll ( and not Crackme2.exe ).
  198. U need to get out of this call , to get to the program code ,for that press
  199. F12 (p ret) , that will tell s-ice to let the computer proceed (p) until
  200. the RET command.
  201.  ┌───────────────────────────────────────────   Side Reference  ──
  202.  │The program is build procedures by procedures , where each procedure has it's
  203.  │own task to do in the general,big,continues run of the program.
  204.  │So when the GetDlgItemTextA procedure is called from the program , the
  205.  │location (the status of the big run) is saved , and the procedure is executed
  206.  │until a Ret command , which tell the procesor to RETurn to the calling part.
  207.  │It's prety much like in Music (take Bach's Fuges for example;) , u have to
  208.  │finish a certain melody before u enter a new one .. (DaVinci will back me up
  209.  │on this...i think :)
  210.  └───────────────────────────────────────────────────────────────────────
  211. Ok,after presing F12 once ,the GetDlgItemTextA funcion is executed,
  212. and s-ice pops in the calling part. u'll see in that line 'CRACKME2!CODE+02C2' which
  213. tell us that we r now looking in the program code .(The figure of winice screen
  214. --look above-- shows where u r now.)
  215. Remember what the function does ? It takes the Text in the edit box, and copy
  216. it to the Program memory , where the program is free to play,change and eat
  217. the password entered .
  218. So where is that location ?
  219. This location (the Buffer for the text) is entered as paramter for the
  220. GetDlgItemTextA funcion .
  221. Normaly parameters are entered throu the stack like this :
  222.  
  223.     .
  224.     .
  225.  push 00000011          ;Parameter #4
  226.  push 0040217E          ;Parameter #3
  227.  push 000003E8          ;Parameter #2
  228.  push [ebp+08]          ;Parameter #1
  229.  Call GetDlgItemTextA
  230.  
  231. In this Function the parameters are :
  232. Parameter #1            // handle of dialog box
  233. Parameter #2            // identifier of control
  234. Parameter #3            // address of buffer for text  <-The 1 we'r interested
  235. Parameter #4            // maximum size of string
  236.  
  237. But u don't have to remember all this , just Check them all ! :)
  238. it's only 4 parameter .
  239. How to check ?
  240. Since we r looking for an addres , the parameter for it is a pointer
  241. for that Buffer ,So we'll have to View the memory at those locations ; in
  242. S-ice enter :
  243. >D DS:00000011
  244. (D = Dump memory)
  245. Check the Data window , do u see the password entered ? No, try the next
  246. parameter :
  247. >D  DS:0040217E
  248. See the Password entered ? Yes , well ofcource , the 3rd parameter is the
  249. the address of the buffer . :)
  250. Now what should we do ?
  251. Now the program is free to do what it wants with the password,wether it's
  252. a simple compare to the correct code (Don't u just love those?) , or
  253. changing it and then a compare , or to check if the serial has the correct
  254. properties of a valid serial (like Length, or if the sum of the password
  255. bytes is equale to a constant) , or whatever the programer had in mind.
  256. And we are here to study this , so Let's breakpoint on that memory address
  257. , in this way  when the program tougchs the password ,s-ice will pop.
  258. Enter : >BPM DS:0040217E RW
  259.        (BPM = BreakPoint on Memory Access ; RW = Read/Write)
  260.  
  261. Before we continue , we should turn off the other BreakPoint We Made .
  262. Do the following :
  263. >BL
  264. U'll Get :      00)   BPX USER32!GetWindowTextA
  265.                 01)   BPX USER32!GetDlgItemTextA
  266.                 02)   BPMB #013F:0040217E RW DR3
  267. >BC 0
  268. (BC = Breakpoint Clear .. since we know GetDlgItemTextA is the function called
  269. and not GetWindowTextA we'll clear it)
  270.  
  271. >BD 1
  272. (BD = Breakpoint Disable .. GetDlgItemTextA will stay in the list , but it
  273. will not be active)
  274. >BL
  275. U'll Get :      01) * BPX USER32!GetDlgItemTextA
  276.                 02)   BPMB #013F:0040217E RW DR3
  277.  
  278.  
  279. And let it roll ..(F5 to continue)
  280.  
  281. NOw the program will continue , and s-ice pops at the place where the program
  282. is operating on the password .
  283.  
  284. U should be at location CS:00401373
  285.  
  286. :00401371 8A06              ╓──>> mov al, byte ptr [esi]
  287. :00401373 84C0              ║     test al, al
  288. :00401375 7419              ║     je 00401390            ────────────┐
  289. :00401377 FE0518214000      ║     inc byte ptr [00402118]            │
  290. :0040137D 3C41              ║     cmp al, 41                         │
  291. :0040137F 7204              ║     jb 00401385       ═╗               │
  292. :00401381 3C5A              ║     cmp al, 5A         ║               │
  293. :00401383 7303              ║     jnb 00401388       ║ ─════╕        │
  294. :00401385 46                ║     inc esi         <<═╝      │        │
  295. :00401386 EBE9              ╟───  jmp 00401371              │        │
  296.                             ║                               │        │
  297. :00401388 E825000000        ║     call 004013B2   <<════════╛        │
  298. :0040138D 46                ║     inc esi                            │
  299. :0040138E EBE1              ╙───  jmp 00401371                       │
  300.                                                                      │
  301.                                                                      │
  302. :00401390 5E                      pop esi          ─────────────────┘
  303. :00401391 E803000000              call 00401399
  304.  
  305. S-ice pops one instrucion after the program access to the password,
  306. so look at the instrucion at 00401371 : Mov al,Byte ptr [esi] .
  307. Do >D ds:esi
  308. see the password ? Ok , so the password is read byte by byte , and somthing
  309. is done to it . Look in a lazy eye on the folowing instructions , like :
  310.  
  311. Cmp Al,41 .. Cmp AL,5A
  312. What is going on ?? Why the values 41 and 5A ?
  313. It's simple , Do
  314. >? 41
  315. 00000041  00000065 "A"
  316. >? 5A
  317. 0000005A  00000090 "Z"
  318.  
  319. Ahah,it checks for small letters , if AL (which is , as said, with a Char
  320. from the password) is with a small letter , then a Call 004013B2 is executed.
  321.  
  322. In large protections , the best way to figure out calls is to look at it
  323. like a Black Box , meening giving it Input , and check the Output , and try
  324. to figure out what was doen (wether a Decimal Value -> hex , OR a value in
  325. a register -> a printable value .. It will save time ; However if a complex
  326. thing is doen , then it's time to trace into the call .)
  327.  
  328. In this case do the folloing :
  329. >Bpx cs:401390
  330. Why there ?
  331. coz that is where the computer (processor) will be after the first operation
  332. on the password.
  333. How do we know that ?
  334. See the
  335.         Test al,al
  336.         je 00401390
  337. It will Jump when the value in al is zero (the end of the password,the null
  338. byte)
  339.  
  340. Press F5 to continue, and s-ice will pop at Location 401390 ,after the first
  341. operation . now check the Password :
  342. >D  DS:0040217E
  343. See that it changed from 'abcDV1234' to 'ABCDV1234' ? The first operation
  344. changes all small letters to capital .
  345.  
  346. Are We done ??
  347. NoNO .. We'll be done when we know where the program 'understands' that u
  348. have entered the wrong password, and this is not it ! (besides , u saw i
  349. said FIRST operation,didn't u ? :)
  350.  
  351. Hopefully ur still with me , i'll continue .. ;)
  352.  
  353. Press F5 to continue and wait for s-ice to pop on the next operation to
  354. our password .
  355.  
  356. [BoooM] , now we r in location 004013A5 :
  357.  
  358. :0040139B 33FF                    xor edi, edi
  359. :0040139D 8A8FA3214000     ╒══>>  mov cl, byte ptr [edi+004021A3]
  360. :004013A3 8A1E             │      mov bl, byte ptr [esi]   ; ESI -> Password
  361. :004013A5 84DB             │      test bl, bl
  362. :004013A7 7408             │      je 004013B1               ───────────┐
  363. :004013A9 32D9             │      xor bl, cl                           │
  364. :004013AB 881E             │      mov byte ptr [esi], bl               │
  365. :004013AD 46               │      inc esi                              │
  366. :004013AE 47               │      inc edi                              │
  367. :004013AF EBEC             ╘════  jmp 0040139D                         │
  368. :004013B1 C3                      ret                ─────────────────┘
  369.  
  370.  
  371. [ This operation is the main operation on the password , so we'll study it to
  372.   understand the protection ..]
  373.  
  374.  
  375. Ok , we should take it slow , trace throu the code , and watch what's going
  376. on . To trace press F8 , this will let the current instruction to be executed
  377. and pause again in the next instuction.
  378.       ┌────────────────────────────── Side reference
  379.       │ How to navigate in WinIce ?
  380.       │ To scroll thou the CODE window , keep CTRL pressed and move with
  381.       │ up/down arrows .
  382.       │
  383.       │ To scroll thou the DATA window , keep ALT  pressed and move with
  384.       │ up/down arrows .
  385.       │
  386.       │ To scroll thou the USER window , keep SHIfT pressed and move with
  387.       │ up/down arrows .
  388.       │
  389.       └─────────────────────────────────────────────────────
  390. Let's see where we are now (at location 4013A5) :
  391. >d ds:esi       will give us the password , so esi points to password.
  392. Look at bl , it has the first char of the password.
  393. EDI=1 and gets INCed in each loop , so edi = Loop index ,and also the
  394. Password Index.
  395. CL has a value from location [edi+004021A3] , that meens  in each loop
  396. CL gets a value from a constant table . To look at this Table do :
  397. >D ds:004021A3
  398. u'll get :
  399.  
  400. 013F:004021A3 4D 65 73 73 69 6E 67 5F-69 6E 5F 62 79 74 65 73  Messing_in_bytes
  401. 013F:004021B3 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
  402.  
  403. Bl gets XORed with CL , and the Result is put back to the password location.
  404. (xor bl, cl   ; mov byte ptr [esi], bl )
  405.  
  406. Confused ? Welcome to the club ;)
  407.  
  408.  
  409. to Sumerize, the english translation of this code_block will be :
  410. A byte from password goes to bl , a value from a constant table (004021A3)
  411. goes to cl , and they get XORed , the result is put back to the password
  412. address [ds:esi] .
  413.  
  414.  
  415. If translated to Pascal it will be something like this :
  416.  
  417.    edi:=1;
  418.    while Pass[edi]<>#0 do
  419.    Begin
  420.            cl := Tab[edi];
  421.            bl := Pass[edi];
  422.            bl := bl Xor Cl;
  423.            Pass[edi] := bl;
  424.            Inc(edi);
  425.    End;
  426.  
  427.  
  428. Password:   41 42 43 44 56 31 32 33 34                       ABCDV1234
  429.          Xor
  430. Table:      4D 65 73 73 69 6E 67 5F 69                       Messing_i
  431.            ------------------------------                  -------------
  432. Result:     0C 27 30 37 3F 5F 55 6C 5D                       .'07?_uL]
  433.  
  434.  
  435. Ok , that was the second operation on the password , as u see the program
  436. played 'scramble' with it ;)
  437.  
  438. Press F5 to continue.
  439. Our next Stop is at location 4013C9.
  440. Let's have a look :
  441.  
  442. :004013B8 33FF                    xor edi, edi
  443. :004013BA 33C9                    xor ecx, ecx
  444. :004013BC B110                    mov cl, 10
  445. :004013BE 8B742404                mov esi, dword ptr [esp+04]
  446. :004013C2 BF50214000              mov edi, 00402150
  447. :004013C7 F3                      repz cmpsb
  448. :004013C9 C3                      ret
  449.  
  450. What do we have here ? A 'rep cmpsb' !!
  451. This instrucion is used to COMPARE the string at address DS:ESI with a string
  452. at address ES:EDI .
  453. This is where the program desides wether it's the correct password.
  454.  
  455. Do  >D ds:esi  to see ur password (after the 2nd operation)
  456. and >D es:edi  to see the string that should be after the second operation .
  457.  
  458. Now that we have done all this work , we'll do just a bit more to find out
  459. the Correct password , the one to put in the registration window.
  460.  
  461. What we are looking is a password , that after the 2nd operation will give us
  462. the following string :
  463. >D es:edi
  464.            ┌────────────────────────────────────────────────┐
  465. 013F:402150│1F 2C 37 36 3B 3D 28 19 3D 26 1A 31 2D 3B 37 3E │.,76;=(.=&.1-;7>
  466.            └────────────────────────────────────────────────┘
  467.  
  468. So we need to 'reverse' the 2nd operation .
  469. As we've seen,in the 2nd op. basicly, the password is XORed with a constant
  470. one .
  471. the XOR instrucion is good for encryptions , why ? Becouse it is REVERSABLE .
  472.  
  473. REVERSABLE ??
  474.  
  475.        ┌────────────────────  Side Reference
  476.        │XOR Val1 , Val2
  477.        │     
  478.        │Val2 = Val1 XOR Val2
  479.        │
  480.        │Xor is a logic operation between the 2 operands (val1 and val2) ,
  481.        │The logical operation is for the situation of :
  482.        │"If Smith goes to the Party , Than John Won't"
  483.        │So there are only 2 posible way : Eighter Only Smith will go , Or
  484.        │Only John will go , BUT they can't be there together , and they can't
  485.        │NOT be there together .
  486.        │Here's the true table for XOR :
  487.        │
  488.        │  Val1 │ Val2 │ Val1 XOR Val2
  489.        │ ──────┼──────┼─────────────────
  490.        │   0   │  0   │      0
  491.        │   0   │  1   │      1
  492.        │   1   │  0   │      1
  493.        │   1   │  1   │      0
  494.        │
  495.        │When we have 31 XOR  6E , there's a Bit_2_Bit Xor meening :
  496.        │
  497.        │       31           00110001
  498.        │   XOR
  499.        │       6E           01101110
  500.        │     ------        ----------
  501.        │       5F           01011111
  502.        └───────────────────────────────────────────────────────
  503.  
  504. Yes, meening : if       a XOR b = c
  505.                then     a XOR c = b
  506.                                     AND
  507.                         b XOR c = a
  508.  
  509. if u have the result (c) and one of the Opreands (a or b) then u get find
  510. the second operand . (XOR is also good for more than 2 operands)
  511.  
  512. Example :               31 XOR 6E = 5F
  513.                              
  514.                         5F XOR 31 = 6E
  515.  
  516.  
  517. Like ADD is the reverse of SUB (and vis versa) ,OR Like Blur is The reverse
  518. operation of sharpen (in PS filters;) , so is XOR the reverse of itself.
  519.                                     |
  520. Meening : 14 - 0F = 5               |     24 XOR 73 = 57
  521.                                    |         
  522.           5  + 0F = 14              |     57 XOR 73 = 24
  523.                                     |
  524.  
  525. To test it u can use s-ice too !
  526. use the '?' command (which is a very powerful command .)
  527. where '^' = XOR
  528.       '&' = AND
  529.       '|' = OR
  530.       '!' = NOT
  531.  
  532.  
  533. >?  31 ^ 6E
  534. 0000005F
  535.  
  536. >?  5F ^ 31
  537. 0000006E
  538.                       ┌────────
  539.                       │ >? esi             ;to see the value in esi ..
  540.                       │ >? al & 13         ;result of :  Value_In_Al AND 13
  541.                       └────────────────────────────────────
  542.  
  543. And guess what ?  We have the result (the string at 00402150) , and we have
  544. one of the operands (the constant string at 004021A3) , so all there left
  545. to do is XOR them to find the 2nd operand , the correct string !
  546.  
  547. Result :   1F 2C 37 36 3B 3D 28 19 3D 26 1A 31 2D 3B 37 3E  .,76;=(.=&.1-;7>
  548.        XOR
  549. Table :    4D 65 73 73 69 6E 67 5F 69 6E 5F 62 79 74 65 73  Messing_in_bytes
  550.           ------------------------------------------------  ----------------
  551. Password:  52 49 44 45 52 53 4F 46 54 48 45 53 54 4F 52 4D  RIDERSOFTHESTORM
  552.  
  553. That's it !! the password is : "RidersOfTheStorm" !!
  554. Let's check it , disable all breakpoints (so s-ice won't pop) :
  555. >BD *
  556. Press F5 to continu .. goto Help/Enter Password and enter :
  557.   RidersOfTheStorm
  558. (you can put it in small letters since it will be converted to capitals
  559.  in the 1st operant ;)
  560. And BooM , we get a 'Great Work , Mate!' message :))
  561.  
  562.  
  563.  
  564. Apendix : Tips For WinIce
  565. ═════════════════════════════╝
  566. Here are some functions that u should break point in s-ice when cracking
  567. varius protections .
  568.   ┌─────────────────────
  569.   │ Note : Case u get a 'symble not defined' message from s-ice , use the EXP
  570.   │ command (EXP = Display Export Symbols) , for example :
  571.   │
  572.   │ >EXP Message
  573.   │ USER
  574.   │      1817:006E MESSAGEBOXINDIRECT       1817:0013 MESSAGEBOXEX
  575.   │      1817:0000 MESSAGEBOX               1817:1E6A MESSAGEBEEP
  576.   │ USER32
  577.   │ 0137:BFC023C1 MessageBeep
  578.   │ 0137:BFC038D9 MessageBoxA
  579.   │ 0137:BFC02BEC MessageBoxExA
  580.   │ 0137:BFC038F3 MessageBoxExW
  581.   │ 0137:BFC03D71 MessageBoxIndirectA
  582.   │ 0137:BFC01014 MessageBoxIndirectW
  583.   │ 0137:BFC039A4 MessageBoxW
  584.   │
  585.   │ Hey look at that , there's a MessageBoxIndirectA symble ;)
  586.   └────────────────────────────────────────────────────────
  587.  
  588. Reading/Writing files :
  589. -----------------------
  590. ReadFile
  591. WriteFile
  592. CreateFileA
  593. SetFilePointer
  594.  
  595. Reading date from INI file :
  596. ----------------------------
  597. (The 'A' at the end is for 32 bit program ... don't worry about it , most
  598.  of the programs are 32 bit, and if they're not , use the same function name
  599.  without the 'A' .. Or use EXP command ;)
  600.  
  601. GetPrivateProfileStringA
  602. GetPrivateProfileIntA
  603. WritePrivateProfileStringA
  604. WritePrivateProfileIntA
  605.  
  606. Registery Access :
  607. ------------------
  608. RegCreateKeyA
  609. RegDeleteKeyA
  610. RegQueryValueA
  611. RegCloseKeyA
  612. RegOpenKeyA
  613.  
  614. DialogBoxes :
  615. -------------
  616. GetWindowTextA
  617. GetDlgItemTextA
  618. GetDlgItemInt
  619.  
  620. MessageBoxes :
  621. ---------------
  622. MessageBox
  623. MessageBoxA
  624. MessageBoxExA
  625. MessageBeep
  626.  
  627. Time And Date :
  628. ---------------
  629. GetLocalTime
  630. GetSystemTime
  631. GetFileTime
  632.  
  633. Creating a window (like a Nag) :
  634. --------------------------------
  635. CreateWindowExA
  636. ShowWindow
  637.  
  638.  
  639. CD-Rom :
  640. --------
  641.  
  642. GetDriveTypeA
  643. GetLogicalDrivesA
  644. GetLogicalDriveStringsA
  645.  
  646. HelpFul in hunting serials in VB program : HMEMCPY
  647.  
  648. * For more info check the win32 programmer reference help file .
  649.  
  650.  
  651.  
  652.  
  653. Last Words
  654. ════════════╝
  655. Cracking is a skill only time and practice will make better , and most
  656. importent NEVER say NEVER . :)
  657.  
  658.  
  659. I really hope u enjoyed this tut , as i did writing it .
  660. Feel Free to ask me anything u want .
  661.  
  662. E-mail :  phrozen_q@cyberdude.com
  663. IcQ    :  8175894
  664.  
  665.  
  666.  
  667. GreetZ
  668. ════════╝
  669. DaVinci , This tut is For ya mate! :)
  670. EveryOne in PC .. UR the BEST ! :)
  671. And all my freinds in Israel who keep asking me "How do u do it??" and i keep
  672. answering "This is kinda magic ;)"
  673.  
  674.  
  675. L8r !
  676. -THE_q
  677.